< previous page page_198 next page >

Page 198
Example Filename: String.frm
For each of the functions listed in this section, you can click the corresponding button on the form to see the results.
Format$( )
Format$() returns a string in a specified format. You can pass date, time, number, or string data to this function, along with instructions on how to format the string. This function replaces the Print Using statement in older BASIC languages. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdFormat_Click ()
   Me.Cls
   Me.Print Format$(Now, "General Date")
   Me.Print Format$(Now, "Short Date")
   Me.Print
   Me.Print Format$(50, "Currency")
   Me.Print Format$(1250, "Currency")
   Me.Print
   Me.Print Format$(0, "Yes/No")
   Me.Print Format$(1, "Yes/No")
   Me.Print Format$(0, "True/False")
   Me.Print Format$(1, "True/False")
   Me.Print Format$(0, "On/Off")
   Me.Print Format$(1, "On/Off")
End Sub
String$( )
String$() returns a string made up of a specific number of characters. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdString_Click ()
   Me.Cls
   Me.Print String$(20, "*")
   Me.Print String$(5, "#")
   Me.Print String$(30, "-")
End Sub

 
< previous page page_198 next page >

If you like this book, buy it!